package ms.maplestory.boot.client.character.quest.requirement;

import lombok.Getter;
import lombok.Setter;
import ms.maplestory.boot.client.character.Char;
import ms.maplestory.boot.loaders.DatSerializable;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

@Getter
@Setter
public class QuestStartCompletionRequirement implements QuestStartRequirement {

    private int questId;
    private int questStatus;

    public QuestStartCompletionRequirement() {
    }

    public QuestStartCompletionRequirement(int questId, byte questStatus) {
        this.questId = questId;
        this.questStatus = questStatus;
    }

    @Override
    public boolean hasRequirements(Char chr) {
        return false;
    }

    @Override
    public void write(DataOutputStream dos) throws IOException {
        dos.writeInt(getQuestId());
        dos.writeInt(getQuestStatus());
    }

    @Override
    public DatSerializable load(DataInputStream dis) throws IOException {
        QuestStartCompletionRequirement questStart = new QuestStartCompletionRequirement();
        questStart.setQuestId(dis.readInt());
        questStart.setQuestStatus(dis.readInt());
        return questStart;
    }
}
